void main(List<String> args) {
  // 创建对象
  Student s1=Student(name:"李四11",age:20,sex:"女",no:"1001");
  
  s1.sayHello();
  
}
class Person{
  String? name= "张三";
  int? age= 18;
  String? sex= "男";
  // 定义构造函数
  // Person({String? name,int? age,String? sex}){
  //   this.name=name??this.name;
  //   this.age=age??this.age;
  //   this.sex=sex??this.sex;
  // }
  //构造函数的语法糖
  Person({this.name,this.age,this.sex});
  void sayHello(){
    print("你好，我是$name");
  }

}
class Student extends Person{
  String? no;
  Student({this.no,super.name,super.age,super.sex});
  @override
  void sayHello(){
    print("你好，我是$name，我的学号是$no");
  }
}
